#include "bomfileselect.h"
#include "ui_bomfileselect.h"

BomFileSelect::BomFileSelect(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::BomFileSelect)
{
    ui->setupUi(this);
    ui->commit_push_button->setEnabled(false);
}

BomFileSelect::~BomFileSelect()
{
    delete ui;
}

void BomFileSelect::f_setList(QStringList list)
{
    ui->listWidget->addItems(list);
}

void BomFileSelect::on_listWidget_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous)
{
    this->m_name = ui->listWidget->currentItem()->text();

    ui->commit_push_button->setEnabled(true);
}

void BomFileSelect::on_commit_push_button_clicked()
{
    if(this->m_name != "")
    {
        this->accept();
    }
}

void BomFileSelect::on_cancel_push_button_clicked()
{
    this->reject();
}
